if(!jsx3.lang.Class.forName("ux.cdb.admin.mechanism.schema.loanassist.builder.SchemaAttachment")) {
	jsx3.lang.Class.defineClass("ux.cdb.admin.mechanism.schema.loanassist.builder.SchemaAttachment",
			ux.megatron.gui.WizardPanel,
			null,
			function (block) {
				/**
				 * instance initializer
				 * @param strName {String} unique name distinguishing this object from all other JSX GUI objects in the JSX application
				 * @param vntLeft {int|String} either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
				 * @param vntTop {int|String} either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
				 * @param vntWidth {int|String} either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
				 * @param vntHeight {int|String} either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
				 * @param strHTML {String} Text/HTML markup to place in the jsx3.gui.Block instance
				 */
				block.prototype.debug=false;//switch of the log message
				block.prototype.wizard=null;
				block.prototype.init = function(strName, vntLeft, vntTop, vntWidth, vntHeight, strHTML) {
					//call constructor for super class (the super expects the name of the object and the function that it is an instance of)
					this.jsxsuper(strName, vntLeft, vntTop, vntWidth, vntHeight, strHTML);
				};

				block.prototype.initialize = function(msg) {
					this.wizard=this.getAncestorOfType("ux.cdb.admin.mechanism.schema.SchemaWizard");
					this.focus();
					//this.wizard = this.getAncestorOfType("ux.megatron.gui.SteppedWizard");
				}

				block.prototype.onNext = function(objWIZARD, objBUTTON, objEVENT, strCURRENTPANEL) {
					return null; // return "NONE" to not next panels
				}

				block.prototype.onPrev = function(objWIZARD, objBUTTON, objEVENT, strCURRENTPANEL) {
					return null; // return "NONE" to not advance panels
				}

				block.prototype.onRevert = function(objWIZARD, objBUTTON, objEVENT, strCURRENTPANEL) {
					return null; // return "NONE" to not last status
				}
				block.prototype.onFinish = function(objWIZARD, objBUTTON, objEVENT, strCURRENTPANEL){
					//user clicked finish  assemble the object
					//get the data about baseinfo

					
					
					var me = this;
					//get the baseinfo
					var data = this.wizard.getDescendantOfName("blkSchemaLoanAssistBaseinfo").getDataAsObject();
					
					//get interest ratio
					
					var intInfo = this.wizard.getDescendantOfName("mtxEditInterest").getXML().getChildNodes();
					//add the intInfo into data

			
					data.centralFinanceSubsidyPct1 = intInfo.get(0).getAttribute("jsxcenter");//中央分担比例
					data.provinceFinanceSubsidyPct1 = intInfo.get(0).getAttribute("jsxprovince");//省分担比例
					data.cityFinanceSubsidyPctSubsidy1 = intInfo.get(0).getAttribute("jsxcity");//市分担比例
					data.countyFinanceSubsidyPct1 = intInfo.get(0).getAttribute("jsxcounty");//县分担比例
					data.otherPartSubsidyPct1 = intInfo.get(0).getAttribute("jsxothers");//其他分担比例
					var intOtherName = this.wizard.getDescendantOfName("txtInterestOthers").getValue();
					data.otherSharePartyNameSubsidy1 = intOtherName;//其他名称
					data.centralFinanceSubsidyPct2 = intInfo.get(1).getAttribute("jsxcenter");//中央分担比例
					data.provinceFinanceSubsidyPct2 = intInfo.get(1).getAttribute("jsxprovince");//省分担比例
					data.cityFinanceSubsidyPctSubsidy2 = intInfo.get(1).getAttribute("jsxcity");//市分担比例
					data.countyFinanceSubsidyPct2 = intInfo.get(1).getAttribute("jsxcounty");//县分担比例
					data.otherPartSubsidyPct2 = intInfo.get(1).getAttribute("jsxothers");//其他分担比例
					data.otherSharePartyNameSubsidy2 = intOtherName;//其他名称
					data.centralFinanceSubsidyPct3 = intInfo.get(2).getAttribute("jsxcenter");//中央分担比例
					data.provinceFinanceSubsidyPct3 = intInfo.get(2).getAttribute("jsxprovince");//省分担比例
					data.cityFinanceSubsidyPctSubsidy3 = intInfo.get(2).getAttribute("jsxcity");//市分担比例
					data.countyFinanceSubsidyPct3 = intInfo.get(2).getAttribute("jsxcounty");//县分担比例
					data.otherPartSubsidyPct3 = intInfo.get(2).getAttribute("jsxothers");//其他分担比例
					data.otherSharePartyNameSubsidy3 = intOtherName;//其他名称
					//get compensate ratio
	
					data.riskSharePct = this.wizard.getDescendantOfName("blkCmpRatio").getDescendantOfName("txtValue").getValue();
					var cmpInfo = this.wizard.getDescendantOfName("mtxEditCmp").getXML().getChildNodes();
					
					data.centralFinanceSharedPct1 = cmpInfo.get(0).getAttribute("jsxcenter");//中央分担比例
					data.provinceFinanceSharePct1 = cmpInfo.get(0).getAttribute("jsxprovince");//省分担比例
					data.cityFinanceSubsidyPct1 = cmpInfo.get(0).getAttribute("jsxcity");//市分担比例
					data.countyFinanceSharePct1 = cmpInfo.get(0).getAttribute("jsxcounty");//县分担比例
					data.otherPartSharePct1 = cmpInfo.get(0).getAttribute("jsxothers");//其他分担比例
					var cmpName =this.wizard.getDescendantOfName("txtCmpOthers").getValue();//其他名称
					data.otherSharePartyName1 = cmpName;//其他分担比例
					data.centralFinanceSharedPct2 = cmpInfo.get(1).getAttribute("jsxcenter");//中央分担比例
					data.provinceFinanceSharePct2 = cmpInfo.get(1).getAttribute("jsxprovince");//省分担比例
					data.cityFinanceSubsidyPct2 = cmpInfo.get(1).getAttribute("jsxcity");//市分担比例
					data.countyFinanceSharePct2 = cmpInfo.get(1).getAttribute("jsxcounty");//县分担比例
					data.otherPartSharePct2 = cmpInfo.get(1).getAttribute("jsxothers");//其他分担比例
					data.otherSharePartyName2 = cmpName;//其他分担比例
					data.centralFinanceSharedPct3 = cmpInfo.get(2).getAttribute("jsxcenter");//中央分担比例
					data.provinceFinanceSharePct3 = cmpInfo.get(2).getAttribute("jsxprovince");//省分担比例
					data.cityFinanceSubsidyPct3 = cmpInfo.get(2).getAttribute("jsxcity");//市分担比例
					data.countyFinanceSharePct3 = cmpInfo.get(2).getAttribute("jsxcounty");//县分担比例
					data.otherPartSharePct3 = cmpInfo.get(2).getAttribute("jsxothers");//其他分担比例
					data.otherSharePartyName3 = cmpName;//其他分担比例

					if (!this.wizard.isEdit) {
						//add mode
						ux.megatron.util.Dwr.callDwr("AddCooperAgreementUCC", "saveCooperAgreementInfo", [data, null], me, me.schemaMessageSaved);
						if (this.debug) {
							alert("loaded");
						}
					}
					else{
						//edit mode
						if (this.debug) {
							alert(ux.megatron.util.JSON.JSONtoString(data));
						}
						ux.megatron.util.Dwr.callDwr("MaintainCooperAgreementUCC", "updateCooperAgreement", [data], me, me.schemaMessageSaved);
						if (this.debug) {
							alert("ipdate loaded")
						}
					}

				}
				//schema message saved
				block.prototype.schemaMessageSaved=function(objEvent)
				{//received the back message close wizard
					if (this.debug) {
						alert(ux.megatron.util.JSON.JSONtoString(objEvent));
					}
					this.getAncestorOfType("ux.cdb.admin.mechanism.schema.SchemaWizard").onCancel();
					
				}
				block.prototype.onCancel = function(objWIZARD, objBUTTON, objEVENT, strCURRENTPANEL) {
					this.getAncestorOfType("ux.cdb.admin.mechanism.schema.SchemaWizard").onCancel();
					return null; // return "NONE" to not advance panels
				}

				block.prototype.onCustomNav = function(objWIZARD, objBUTTON, objEVENT, strCURRENTPANEL) {
					return null; // return "NONE" to not advance panels
				}

				block.prototype.onBeforeShow = function(objWIZARD, objBUTTON, objEVENT, strLASTPANEL) {
					if(!this.getChild(0)) {
						var me = this;
						ux.megatron.Main.loadUIResourceAsync(me, "ux.cdb.admin","ux/cdb/admin/mechanism/schema/loanassist/builder/step4/ui/SchemaAttachmentContent.xml", me, me.initialize);
					}
					return null; // return "NONE" to not advance panels
				}

				block.prototype.onAfterHide = function(objWIZARD, objBUTTON, objEVENT, strNEXTPANEL) {
					return null; // return "NONE" to not advance panels
				}
			}
	);
}
